package edu.uestc.gene.scripts.combination.entity;

import java.util.ArrayList;
import java.util.List;

import edu.uestc.gene.entity.Gene;

/**
 * @author Carl
 * 
 *         2013-10-30
 */
public class Group {

	private List<Frequencies> freq;

	public List<Frequencies> getFreq() {
		return freq;
	}

	public void setFreq(List<Frequencies> freq) {
		this.freq = freq;
	}

	public List<Frequencies> findFrequenciesByGene(Gene gene) {
		return findFrequenciesByGene(freq, gene);
	}

	public List<Frequencies> findFrequenciesByGene(List<Frequencies> target,
			Gene gene) {
		List<Frequencies> results = new ArrayList<Frequencies>();
		for (int i = 0; i < target.size(); i++) {
			if (target.get(i).isExist(gene)) {
				results.add(target.get(i));
			}
		}
		return results;
	}

}
